package com.hospital.service.sample.model.param;


import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.sample.entity.SamInfoDetails;
import com.hospital.service.sample.entity.help.SamInfoDetailsHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import enhance.plus.util.MybatisPlusUtil;
import enhance.plus.util.PageHelper;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 实验样本详细表 新增参数
 *
 * @author lfb
 * @created 2020-10-10 14:27:13
 */
@Data
@ToString
@Accessors(chain = true)
@ApiModel(value="SamInfoDetails[实验样本详细表]分页查询")
public class SamInfoDetailsQueryPageParam implements Serializable{


    /**
     * 所属的样本编号
     */
    @ApiModelProperty(value = "所属的样本编号", required = false , example = "")
    private String samplesNumber;

    /**
    * 把非 null 的值 转换成一个 查询条件
    * @return
    */
    public QueryWrapper<SamInfoDetails> convertParamToQueryWapper(){
        QueryWrapper<SamInfoDetails> query = SamInfoDetailsHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, SamInfoDetails.class);
        query.allEq(result);
        return query;
    }
}
